package com.ruoyi.business.mapper;

import java.util.Date;
import java.util.List;
import com.ruoyi.business.domain.JtPurchaseOrder;
import com.ruoyi.business.domain.JtPurchaseOrderItem;
import com.ruoyi.business.domain.vo.JtPurchaseOrderVo;
import org.apache.ibatis.annotations.Param;

/**
 * 采购单Mapper接口
 * 
 * @author Alan Zhang
 * @date 2025-03-29
 */
public interface JtPurchaseOrderMapper 
{
    /**
     * 查询采购单
     * 
     * @param purchaseId 采购单主键
     * @return 采购单
     */
    public JtPurchaseOrder selectJtPurchaseOrderByPurchaseId(Long purchaseId);

    /**
     * 查询采购单列表
     * 
     * @param jtPurchaseOrder 采购单
     * @return 采购单集合
     */
    public List<JtPurchaseOrder> selectJtPurchaseOrderList(JtPurchaseOrder jtPurchaseOrder);

    /**
     * 新增采购单
     * 
     * @param jtPurchaseOrder 采购单
     * @return 结果
     */
    public int insertJtPurchaseOrder(JtPurchaseOrder jtPurchaseOrder);

    /**
     * 修改采购单
     * 
     * @param jtPurchaseOrder 采购单
     * @return 结果
     */
    public int updateJtPurchaseOrder(JtPurchaseOrder jtPurchaseOrder);

    /**
     * 删除采购单
     * 
     * @param purchaseId 采购单主键
     * @return 结果
     */
    public int deleteJtPurchaseOrderByPurchaseId(Long purchaseId);

    /**
     * 批量删除采购单
     * 
     * @param purchaseIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteJtPurchaseOrderByPurchaseIds(String[] purchaseIds);

    /**
     * 批量删除采购单明细
     * 
     * @param purchaseIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteJtPurchaseOrderItemByPurchaseIds(String[] purchaseIds);

    /**
     * 批量删除采购单明细
     *
     * @param itemIds 需要删除的数据主键集合
     * @return 结果
     */
    public int  deleteJtPurchaseOrderItemByIds(String[] itemIds);
    
    /**
     * 批量新增采购单明细
     * 
     * @param jtPurchaseOrderItemList 采购单明细列表
     * @return 结果
     */
    public int batchJtPurchaseOrderItem(List<JtPurchaseOrderItem> jtPurchaseOrderItemList);
    

    /**
     * 通过采购单主键删除采购单明细信息
     * 
     * @param purchaseId 采购单ID
     * @return 结果
     */
    public int deleteJtPurchaseOrderItemByPurchaseId(Long purchaseId);

    /**
     * 修改采购单明细
     *
     * @param jtPurchaseOrderItem 采购单明细
     * @return 结果
     */
    public int updateJtPurchaseOrderItem(JtPurchaseOrderItem jtPurchaseOrderItem);


    /**
     * 审核
     * @param purchaseIds 采购单ID
     * @return
     */
    public int auditJtPurchaseOrderByPurchaseIds(@Param("purchaseIds") String[] purchaseIds, @Param("auditBy") String auditBy, @Param("auditTime") Date auditTime);

    /**
     * 反审核
     * @param purchaseIds 采购单ID
     * @return
     */
    public int unAuditJtPurchaseOrderByPurchaseIds(@Param("purchaseIds") String[] purchaseIds, @Param("auditBy") String auditBy, @Param("auditTime") Date auditTime);


    /**
     * 完成采购单
     * @param purchaseIds 采购单ID
     * @return
     */
    public int finishedJtPurchaseOrderByPurchaseIds(@Param("purchaseIds") String[] purchaseIds, @Param("updateBy") String updateBy, @Param("updateTime") Date updateTime);

    /**
     *
     * @param purchaseIds
     * @return
     */
    public List<JtPurchaseOrderVo>selectJtPurchaseOrderVoByPurchaseIds(String[] purchaseIds);

    /**
     * 查询采购单号
     * @param orderNo
     * @return
     */
    public JtPurchaseOrderVo selectJtPurchaseOrderByPurchaseOrderNo(String orderNo);
}
